<?php
$start = microtime( true );
$sum = 0;
for ($i = 0; $i < 1000000; $i++) {
    $sum += $i;
}
$end = microtime( true );
$time = $end - $start;
echo "共花费" . sprintf( "%.3f", $time );